
var div=document.querySelector("div")
Object.assign(div.style,{
    width:"50px",
    height:"50px",
    backgroundColor:"red"
})
div.addEventListener("click",clickHandler);

function clickHandler(){
    div.style.backgroundColor="blue"
}